<?php defined('BASEPATH') OR exit('No direct script access allowed');

// Code here is run before frontend controllers
class Frontend_Controller extends MY_Controller
{
	public function __construct()
	{
		parent::__construct();                                
                $frontend_theme = Settings::get('themes_frontend');                 
                $this->load->library('template',array(
                        'theme_frontend_id' => $frontend_theme
                ));
                $this->template->user = (array) $this->user;
                define('_THEME_SKIN_', _THEME_FRONTEND_.'/skins/'.$this->template->skin);   
                
                //$this->template->skin = site_url('assets/theme_frontend/');
                
                
//                );                      
                //echo $frontend_theme;die;
                //print_r($)
				
		//check for a redirect
		
//                $this->load->model('redirects/redirect_m');
//		$uri = trim(uri_string(), '/');
//		if ($redirect = $this->redirect_m->get_from($uri))
//		{
//			redirect($redirect->to);
//		}

//		Events::trigger('frontend_controller');

		// Check the frontend hasnt been disabled by an admin
//		if ( ! $this->settings->frontend_enabled && (empty($this->user) OR $this->user->group != 'admin'))
//		{
//			$error = $this->settings->unavailable_message ? $this->settings->unavailable_message : lang('cms_fatal_error');
//			show_error($error);
//		}

		// -- Navigation menu -----------------------------------		
	}
}
